#include <stdio.h>
#include <assert.h>

char* my_strncat(char* str1, const char* str2, size_t n)
{
	assert(str1);
	assert(str2);
	char* ret = str1;
	while (*str1)
	{
		str1++;
	}
	char* p = (char*)str2;
	while (n)
	{
		*str1 = *p;
		str1++;
		p++;
		n--;
	}
	*str1 = 0;
	return ret;
}

int main()
{
	char a[20] = "acnf";
	char b[20] = "djasidj";
	printf("%s\n",my_strncat(a, b, 6));
	return 0;
}